new Vue({
  el: '#app',
  data() {
    return {
      form: {
        Article_Name: "",
        Category_SerialNumber: "",
        Enterprise_Info_SerialNumber: $.cookie("enterprise"),
        Type: "1",
        token: $.cookie("token"),
        page: 1,			//页数
        limit: 10,			//每页数据条数
      },
      form1: {
        // Article_Name: "",
        hotspot: '1',  //0是消息1消息条数
        Type: "1",   //1是自己0是全部
        Row_Status: '',  //空是全部0是未读1是已读
        token: $.cookie("token"),
        Enterprise_Info_SerialNumber: $.cookie("enterprise"),
        page: 1,			//页数
        limit: 10,			//每页数据条数
      },
      Release: '0',
      badge: '',
      formData: {},
      dialogFormVisible: false,
      Multistage: [{
        id: '',
        Article_SerialNumber: '',
        Unit_Price: '',
        Quantity: '',
      }],
      tableData: [],
      tablePic: [],
      Pic: [],
      loading: false,
      total: 1,
      dialogForm: false,
      title: '',
      multipleSelection: [],
      Enterprise_Info_SerialNumber: $.cookie("enterprise")
    }
  },
  mounted() {
    this.getList(this.form)
    //消息条数
    this.getbadge(this.form1)
  },
  methods: {
    onSerach() {				//查询方法
      console.log("搜搜")
    },
    addContract() {
      console.log("跳转")
    },
    reviseEnterprise() {
      window.location.href = './Revise.html'
    },
    handleSizeChange(val) {
      this.form.page = 1;
      this.form.limit = val;
    },
    handleCurrentChange(val) {
      this.form.page = val;
    },
    handlePreview(Article_SerialNumber) {
      this.Pic = []
      this.tablePic.filter(item => {
        return item.Picture_Type == '0' && item.Article_SerialNumber == Article_SerialNumber
      }).forEach(item => {
        this.Pic.push(item.Picture_Url)
      })
    },
    // 获取消息列表
    getList(data) {
      let _this = this
      $.ajax({
        type: 'POST',
        data,
        url: DomainName + '/getGroupSeekProcureAllAction',
        success: function (Result) {
          console.log(Result)
          _this.tableData = Result.tableData;

          _this.total = parseInt(Result.limit)
        },
        complete: function (XMLHttpRequest) {
          if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
          }
        },
        dataType: "json"
      })
    },
    // 获取消息条数
    getbadge(data) {
      let _this = this
      $.ajax({
        type: 'POST',
        data,
        url: DomainName + '/getGroupSeekMessageAllAction',
        success: function (Result) {
          // _this.tableData = Result.tableData;
          console.log(Result, 1111)
          _this.badge = Result.limit
          // _this.total = parseInt(Result.limit)
        },
        complete: function (XMLHttpRequest) {
          if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            window.parent.document.location.href = "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
          }
        },
        dataType: "json"
      })
    },
    //跳转到增加界面
    addEnterprise() {
      window.location.href = './Add.html'
    },
  },
})

